package com.jia.train.member.controller;

import com.jia.train.global.response.BaseResponse;
import com.jia.train.member.request.TicketSaveRequest;
import com.jia.train.member.response.TicketSaveResponse;
import com.jia.train.member.service.TicketService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/ticket")
public class TicketController {

    @Resource
    private TicketService ticketService;

    @PostMapping("/batch/insert")
    public BaseResponse<List<TicketSaveResponse>> createTicket(@RequestBody List<TicketSaveRequest> list) {
        return new BaseResponse<>(ticketService.batchInsert(list));
    }
}
